<p> <a href="<?php echo $this->url(array('controller' => 'visiteur', 'action' => 'ajouter')); ?>">Ajouter un visiteur </a> </p>
<table border="1">
    <tr>
        <th>
            Id
        </th>
        <th>
            Nom
        </th>
        <th>
            Prenom
        </th>
        <th>
            Nombre de langues parlees
        </th>
        <th>
            Langues parlees
        </th>
        <th>
            Action
        </th>
    </tr>

    <?php foreach ($this->paginator as $unVisiteur) : ?>
        <tr>
            <td>
                <?php echo $this->escape($unVisiteur->id); ?>
            </td>
            <td>
                <?php echo $this->escape($unVisiteur->nom); ?>
            </td>
            <td>
                <?php echo $this->escape($unVisiteur->prenom); ?>
            </td>
            <td>
                <?php echo $unVisiteur->getNbLangues();?>
            </td>
            <td>
                <?php 
                    foreach($unVisiteur->getLanguesParlees() as $uneLangue){
                        echo $this->escape($uneLangue['Name'])." ";
                    }?>
            </td>

            <td>
                <a href ="<?php echo $this->url(array('controller' => 'visiteur', 'action' => 'modifierv', 'id' => $unVisiteur['id'])); ?>">Modifier</a>
                <a href ="<?php echo $this->url(array('controller' => 'visiteur', 'action' => 'supprimerv', 'id' => $unVisiteur['id'])); ?>">Supprimer</a>
            </td>
        </tr>
    <?php endforeach; ?>
</table>
<?php
$pages = $this->paginator->getPages();
//var_dump($this->paginator);var_dump($pages);
if (isset($pages->first) && $pages->current != $pages->first) {
    echo"<a href=?page=$pages->first>Debut</a>&nbsp|&nbsp;";
}
if (isset($pages->previous)) {
    echo"<a href=?page=$pages->previous>Precedent</a>&nbsp|&nbsp;";
}
foreach ($pages->pagesInRange as $page) {
    echo "<a href=?page=$page>$page</a>&nbsp|&nbsp;";
}

if (isset($pages->next)) {
    echo"<a href=?page=$pages->next>Suivant</a>&nbsp|&nbsp;";
}
if (isset($pages->last) && $pages->current != $pages->last) {
    echo"<a href=?page=$pages->last>Fin</a>&nbsp";
}
?>
